//定义时间类Time，并计算两个时间之间的间隔。
//Time.hpp
#ifndef _TIME_HPP_
#define _TIME_HPP_
#include <iostream>
#include <string>
using namespace std;
class Time {    
    private:
        int hour;       //时
        int minute;     //分    
        int second;    //秒

    public:
        Time() {    //无参构造
            this->hour;
            this->minute;
            this->second;
        }
        
        Time(int hour, int minute, int second) {//带参构造
            this->hour = hour;
            this->minute = minute;
            this->second = second;
        }

        Time(const Time &time) {//拷贝构造
            this->hour = time.hour;
            this->minute = time.minute;
            this->second = time.second;
        }
        //以下为getter和setter
        void setTime(int hour, int minute, int second) {    
            this->hour = hour;
            this->minute = minute;
            this->second = second;
        }

        string getTime() {
            string str = "";
            str += to_string(hour);
            str += ":";
            str += to_string(minute);
            str += ":";
            str +=  to_string(second);
            //cout << str << endl;
            return str;
        }

        int getHour() {
            return hour;
        }

        int getMinute() {
            return minute;
        }

        int getSecond() {
            return second;
        }

        void setHour(int hour) {
            this->hour = hour;
        }

        void setMinute(int minute) {
            this->minute = minute;
        }

        void setSecond(int second) {
            this->second = second;
        }
};
#endif